package com.smart.controller;

import com.smart.pojo.ResultBean;
import com.smart.service.IStatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("statistic")
public class StatisticController {

    @Autowired
    IStatisticService statisticService;

    @GetMapping("getBusinessData")
    public ResultBean getBusinessData(){
        System.out.println("获取经营数据");
        return ResultBean.success(statisticService.getBusinessData());
    }

    @GetMapping("getInventoryAndTurnoverData")
    public ResultBean getInventoryAndTurnoverData(){
        System.out.println("获取企业产品库存以及年度成交额明细");
        return ResultBean.success(statisticService.getInventoryAndTurnoverData());
    }

    @GetMapping("getSalesAndProfitAndPlanData")
    public ResultBean getSalesAndProfitAndPlanData(){
        System.out.println("获取企业各产品总营销额、利润以及生产计划情况");
        return ResultBean.success(statisticService.getSalesAndProfitAndPlanData());
    }
}
